package cn.stylefeng.guns.czlm.service;

import cn.stylefeng.guns.core.common.page.LayuiPageFactory;
import cn.stylefeng.guns.czlm.entity.TbOrder;
import cn.stylefeng.guns.czlm.mapper.TbOrderMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> {
    @Resource
    private TbOrderMapper ordMapper;

    /**
     * 查询所有订单
     * @author wyt
     * @Date 2018/12/24 22:45
     */
    public Page<Map<String, Object>> selectOrders(String condition) {
        Page page = LayuiPageFactory.defaultPage();
        Page<Map<String, Object>> list=this.ordMapper.selectOrders(page,condition);
        return this.ordMapper.selectOrders(page,condition);
    }

    //按id查询
    public TbOrder selectById(Long id){
        return ordMapper.selectById(id);
    }

    //修改
    public int updateOrderById(TbOrder order){
        return ordMapper.updateById(order);
    }

}
